<template>
  <el-dialog title="新增工单" :visible="visible" @close="closeFn">
    <el-form
      class="form"
      :rules="formrules"
      ref="form"
      :model="form"
      width="200px"
    >
      <!--               区域名称               -->
      <el-form-item prop="regionName" label="区域名称">
          <span class="class">{{thisList[0].region.name}}</span>
      </el-form-item>
      <!--            备注            -->
<!-- {{thisList}} -->
      <el-form-item prop="remark" label="包含点位">
          <template>
            <el-table :data="thisList" size="small" style="width: 80%">
              <el-table-column label="序号" width="100px">
                <template slot-scope="scop">
                  {{ + scop.$index + 1 }}
                </template>
              </el-table-column>
              <el-table-column prop="name" label="点位名称"></el-table-column>
              <el-table-column prop="vmCount" label="设备数量">
              </el-table-column>
            </el-table>
          </template>
      </el-form-item>
    </el-form>
  </el-dialog>
</template>

<script>
export default {
  methods: {
    closeFn () {
      console.log(1)
      this.$emit('closeViewFn')
    }
  },
  props: {
    visible: {
      type: Boolean,
      required: true
    },
    thisList: {
      type: Array,
      required: true
    }
  },
  data () {
    return {
      formrules: {
        regionName: [
          { required: true, message: '这玩意儿不能不填呢', trigger: 'blur' }
        ],
        remark: [{ required: true, message: '这个也得填呢', trigger: 'blur' }]
      },
      tableData: [],
      form: {
        regionName: '',
        remark: ''
      }
    }
  }
}
</script>

<style lang="scss" scoped>
::v-deep .el-dialog {
  border-radius: 25px;
  width: 40%;
  // height: 530px;
}
::v-deep .el-col {
  height: 38px;
  // padding: 15px;
}
::v-deep .el-dialog__body {
  padding: 30px 60px;
}

::v-deep .el-table th.el-table__cell.is-leaf,
.el-table td.el-table__cell {
  padding-top: -20px;
}
.class{
  padding-left: 20px;

}
::v-deep .el-table {
  margin-top: -10px;
  padding-left: 20px;
  padding-top: -50px;
  width: 60%;
  position: relative;
  overflow: hidden;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  width: 100%;
  max-width: 100%;
  background-color: #fff;
  font-size: 14px;
  color: #606266;
}
</style>
